package lex.dm.ui.actions;

import java.awt.event.ActionEvent;
import java.sql.SQLException;

import org.lex.swing.ActionBuilder;

import lex.dm.DTree;

public class AllTablesAction extends ActionBuilder
{
	public AllTablesAction()
	{
		this.setName( "All Tables" );
	}

	@Override
	public void actionPerformed( ActionEvent e )
	{
		DTree app = DTree.getApplication();
		try
		{
			app.getContentPane().addResultSet( "Tables",
				app.getConnection().getMetaData().getTables( null, null, null, null ) );
		}
		catch( SQLException e1 )
		{
			e1.printStackTrace();
		}
	}
}
